package com.htsk.city.services.wechat.params;

import lombok.Data;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

@Data
public class BasePageQueryParam {
    private Integer page;
    private Integer size;

    public Pageable getPageable() {
        return PageRequest.of(page - 1, size, Sort.by(Sort.Direction.DESC, "createdAt"));
    }
}
